import * as actionTypes from './actionTypes';

let nextId = 0;

export function addTodo(text) {
    return {
        type: actionTypes.ADD_TODO,
        id: nextId++,
        text,
        completed: false
    };
}

export function toggleTodo(id) {
    return {
        type: actionTypes.TOGGLE_TODO,
        id
    }
}

export function removeTodo(id) {
    return {
        type: actionTypes.REMOVE_TODO,
        id
    }
}